From: Matthieu Gallien Date: Thu, 24 Apr 2025 08:27:41 +0000 (+0200) Subject: fix(filesystem): warn when trying to delete an already deleted file X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2^2~9^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Program/%22http:/www.example.com/cgi/%22https:/%22Program?a=commitdiff_plain;h=0ced1ee5b96851bcca013a1c861e35832314cce2;p=nextcloud-desktop.git fix(filesystem): warn when trying to delete an already deleted file Signed-off-by: Matthieu Gallien --- diff --git a/src/common/filesystembase.cpp b/src/common/filesystembase.cpp index 441746aae..fafd0eeba 100644 --- a/src/common/filesystembase.cpp +++ b/src/common/filesystembase.cpp @@ -540,6 +540,11 @@ bool FileSystem::remove(const QString &fileName, QString *errorString) // allow that. setFileReadOnly(fileName, false); #endif + const auto deletedFileInfo = QFileInfo{fileName}; + if (!deletedFileInfo.exists()) { + qCWarning(lcFileSystem()) << fileName << "has been already deleted"; + } + QFile f(fileName); if (!f.remove()) { if (errorString) {